package com.nuanshui.heatedloan.credit.facade.third.party;

import com.nuanshui.heatedloan.credit.form.CustomerSesameCreditInfoForm;
import com.nuanshui.heatedloan.credit.response.RiskResponse;
import com.nuanshui.heatedloan.credit.vo.CustomerSesameCreditInfoVO;

import java.util.Map;

/**
 * Created by wangxw on 2017/6/30.
 */
public interface SesameCreditAuthService {

    /***
     * 芝麻认证接口
     * @param customerSesameCreditInfoForm
     * @return
     */
    Map<String,Object> sesameCreditAuth(CustomerSesameCreditInfoForm customerSesameCreditInfoForm);


    /***
     *调用芝麻信用的地址它会返回一个授权的url
     * @param customerSesameCreditInfoForm
     * @throws Exception
     */
    Map<String,Object> sesameCreditAuthByThirdParty(CustomerSesameCreditInfoForm customerSesameCreditInfoForm);

    /***
     *  芝麻信息根据之前请求的时传入的回调地址回调该方法，把值返回给返回回来
     * @param riskResponse
     */
    void getSesameCreditAuthCallBack(RiskResponse riskResponse);

    /***
     * 根据用户的获取认证信息
     * @param userId
     * @return
     */
    CustomerSesameCreditInfoVO loadVOByUserId(String userId);

    /***
     * 新增芝麻用户
     * @param customerSesameCreditInfoForm
     * @return
     */
    void save(CustomerSesameCreditInfoForm customerSesameCreditInfoForm);


    /***
     * 修改芝麻的相关信息数据
     * @param customerSesameCreditInfoForm
     */
    void updateCustomerSesameCreditInfo(CustomerSesameCreditInfoForm customerSesameCreditInfoForm);

    /***
     * 更新数据库中的status字段
     * @param status
     */
    public void updateSesameStatus(int status,String userId);

}
